{extend name="./oscshop/admin/view/public/base.html" /}
{block name="content"}
<div class="page-header">
	<h1>	
		{$breadcrumb1}
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$breadcrumb2}
		</small>
	</h1>
</div>

<form>	
<table class="table table-striped table-bordered table-hover search-form">
	<thead>
		<th>
		{:token()}
		<input name="username" type="text" placeholder="会员手机号码" value="" />	
		<input name="num" type="text" placeholder="充值额度" value="" />
		<a class="btn btn-primary" href="javascript:;" id="search" url="/admin/fin/recharge?type=1">充值</a>	

		</th>
					
	</thead>

	<thead>
		<th>
		<input name="user" type="text" placeholder="会员手机号码" value="" />
		<a class="btn btn-primary" href="javascript:;" id="so" url="{:url('fin/recharge?type=2')}">查询</a>	
			
		</th>
					
	</thead>

</table>	

<div class="row">
	<div class="col-xs-12">	
		<div class="table-responsive">
			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>	
						<th>用户</th>
						<th>姓名</th>
						<th>数量</th>
						<th>时间</th>
						<th>操作员</th>
					</tr>
				</thead>
				<tbody>
						{volist name="list" id="v" empty="$empty"}
						<tr>		
							<td>{$v.username}</td>	
							<td>{:get_member_idcardname($v.username)}</td>
							<td>{$v.num}</td>
							<td>{$v.dt|date="Y-m-d h:i:s",###}</td>

					
							<td>{$v.admin}</td>
						</tr>
						{/volist}	
						
						
				</tbody>
				
			</table>
		</div>
	</div>
</div>
</form>
{/block}
{block name="javascript"}
<script type="text/javascript">
    {notempty name="error"}
    alert("{$error}");
    {/notempty}

</script>
<script>	
$(function(){
   $("#search").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        
        var query1 = '/admin/fin/getuser?'+query;
        //alert(query);
        //alert(getuser);
        var info = '';
        $.get(query1,function(data,status){
        	info=data;
        	//alert(data);
	        if(confirm(data))
	   		{
	   			if (url.indexOf('?') > 0) {
		            url += '&' + query;
		        } else {
		            url += '?' + query;
		        }
		        window.location.href = url;
		        
	   		}
    	});
    	
        //query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        //query = query.replace(/^&/g, '');
        
    });	

      $("#so").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        //query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        //query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });	
});
</script>
{/block}